1. Field of the Invention
This invention relates to an image processing apparatus, an image processing method, and a record medium including a program executable on the image processing apparatus.
2. Description of the Related Art
As one use aspect of an image processing apparatus, it is configured so that edge related information such as an edge position or the maximum edge width about an edge, which a user wishes to obtain, can be calculated by setting an edge window and detecting an edge of a workpiece for detection of variations in workpiece outline. For example, when the maximum edge width W of a workpiece w such as cable shown in FIG. 8 is measured, as shown in FIG. 9, plural edge windows 1 are set and the maximum edge width W4 is decided based on output results of edge widths W1 to W4 between edges 2 and 2 of each the edge window 1. The number of such edge windows 1 varies depending on the image processing apparatus and can be set at, for example, up to 8 to 64.
FIG. 10 is a flowchart showing a related-art operating procedure including setting of an edge window. Referring to the related-art operating procedure according to this flowchart, in step S1, a user decides a width of an edge window in response to fineness of unevenness of a surface of the workpiece w or size of the workpiece w and an edge window 1 according to the window width decided by the user is set (step S2). When it is necessary to set plural edge windows 1, operations of step S2 are repeated. Next, when the workpiece w is set in an image pickup position and a trigger from the outside is inputted to an image processing apparatus, an image pickup of the workpiece w is performed (step S3).
The image processing apparatus captures image pickup data (step S4), and then measures an edge every the edge window 1 set (step S5), and outputs a measured result every each the edge window 1 to an external device (step S6).
The external device receives the measured result every each the edge window 1 (step S7), and performs statistical processing of these and obtains, for example, the maximum edge width, an edge position, the number of edges, etc. (step S8), and thereby performs determination processing (step S9).
However, in setting of the edge window 1, the setting operation becomes more complicated for a user as the number of edge windows 1 to be set increases. Also, the external device is required for performing statistical processing.
Also, in the case of detecting the tip P of the workpiece w having the sharp end as shown in FIG. 11, another problem tends to arise. For example, as shown in FIG. 12, in the case that an edge window 1 in which the entirety of workpiece w having the end of an acute angle is included is set, it becomes difficult to detect the end of the acute angle when the number of pixels read increases in character of a general algorithm of image processing. Therefore, an edge position 2 detected tends to become a position distant from the end of the workpiece w.
Therefore, a user has to set a narrow edge window 1 as shown in FIG. 13A, but when such a narrow edge window 1 is set, it cannot cope flexibly with variations from an image pickup position of the workpiece w. As shown in FIG. 13B, a new problem that there is a high possibility that the end P of an acute angle deviates from the edge window 1 arises.